import fetch from 'utils/fetch';
/**
 * 新手任务
 */
//查看新手任务
export function getNewTask(page,pageSize,startDate,endDate,activeName) {
    const data={
        page,
        pageSize,
        startDate,
        endDate,
        activeName
    }
    return fetch({
        url: '/task/findTasks',
        method: 'post',
        data
    });
  }
  
  //新手任务删除
export function postDeleteTask(ids)
{
    const data={
        ids
    }
    return fetch({
        url: '/task/deleteTasks',
        method: 'post',
        data
    });
}

//新增任务
export function postAddTask(activeName,submitNumber,telFare,startDate,endDate) {
    const data={
        activeName,
        submitNumber,
        telFare,
        startDate,
        endDate
    }
    return fetch({
        url: '/task/addTask',
        method: 'post',
        data
    });
}

//占用时间段列表
export function getTimeRange() {   
    return fetch({
        url: '/task/findUsedDate',
        method: 'post'
    });
}

// 新手任务详情
export function getDetailForTask(taskId,page,pageSize,schoolId,rechargePhone,teacherName,exueCode,status,startDate,endDate) {
    const data = {
        taskId,
        page,
        pageSize,
        schoolId,
        rechargePhone,
        teacherName,
        exueCode,
        status,
        startDate,
        endDate
    }
    return fetch({
        url: '/task/findTaskDetails',
        method: 'post',
        data
    });
}

// 确认充值
export function rechargeById(ids) {
    const data = {
        ids
    }
    return fetch({
        url: '/task/updateTaskDetails',
        method: 'post',
        data
    });
}

// 删除任务详情
export function deleteDetailById(ids) {
    const data = {
        ids
    }
    return fetch({
        url: '/task/deleteTaskDetails',
        method: 'post',
        data
    });
}